import * as echarts from 'echarts'
export const leftTop = {
    backgroundColor: "transparent",
    title: {
        text: '6种',
        left: '39%',
        top: '43%',
        textAlign: 'center',
        textStyle: {
            color: '#fff',
            fontSize: 20,
            fontWeight: 600
        }
    },
    color: ["#16D8BA", "#0F52BE", "#529EFD", "#01E17E", "#3DD1F9", "#FFAD05"],
    grid: {
        left: '-0%',
        top: '0%',
        bottom: 0,
        right: 0,
        containLabel: true
    },
    tooltip: {
        trigger: 'item',
        formatter: "{b} : {c} ({d}%)"
    },
    legend: {
        orient: "vartical",
        // x: "right",
        top: "center",
        right: "-0%",
        // bottom: "0%",
        itemWidth: 16,
        itemHeight: 8,
        itemGap: 8,
        textStyle: {
            color: '#A3E2F4',
            fontSize: 10,
        },
        data: ['吉农大819', '福来818', '辽科38', '天农九', '天宇108', '先玉1224']
    },
    polar: {},
    angleAxis: {
        // show:false,
        interval: 1,
        type: 'category',
        data: [],
        z: 10,
        axisLine: {
            show: false,
            lineStyle: {
                color: "#0B4A6B",
                width: 1,
                type: "solid"
            },
        },
        axisLabel: {
            interval: 0,
            show: true,
            color: "#0B4A6B",
            margin: 8,
            fontSize: 16
        },
    },
    radiusAxis: {
        show:false,
        min: 40,
        max: 120,
        // position:'left',
        x:'-50%',
        interval: 20,
        axisLine: {
            show: false,
            lineStyle: {
                color: "#0B3E5E",
                width: 1,
                type: "solid"
            },
        },
        axisLabel: {
            formatter: '{value} %',
            show: false,
            padding: [0, 0, 20, 0],
            color: "#0B3E5E",
            fontSize: 16
        },
        splitLine: {
            lineStyle: {
                color: "#0B3E5E",
                width: 2,
                type: "solid"
            }
        }
    },
    calculable: true,
    series: [{
        type: 'pie',
        radius: ["5%", "10%"],
        center:['40%','50%'],
        hoverAnimation: false,
        data: [{
            name: '',
            value: 0,
            itemStyle: {
                normal: {
                    color: "#0B4A6B"
                }
            }
        }]
    }, {
        type: 'pie',
        radius: ["90%", "95%"],
        center:['40%','50%'],
        hoverAnimation: false,
        labelLine: {
            normal: {
                show: false,
                length: 30,
                length2: 55
            },
            emphasis: {
                show: false
            }
        },
        name: "",
        data: [{
            name: '',
            value: 0,
            itemStyle: {
                normal: {
                    color: "#56a2f8"
                }
            }
        }]
    }, {
        stack: 'a',
        type: 'pie',
        radius: ['30%', '70%'],
        center:['40%','50%'],
        roseType: 'area',
        zlevel: 10,
        label: {
            normal: {
                show: false,
                formatter: "{c}",
                textStyle: {
                    fontSize: 12,
                },
                position: 'outside'
            },
            emphasis: {
                show: true
            }
        },
        labelLine: {
            normal: {
                show: false,
                length: 20,
                length2: 55
            },
            emphasis: {
                show: false
            }
        },
        data: [{
            value: 819,
            name: '吉农大819'
        },
        {
            value: 818,
            name: '福来818'
        },
        {
            value: 751,
            name: '辽科38'
        },
        {
            value: 554,
            name: '天农九'
        },
        {
            value: 761,
            name: '天宇108'
        },
        {
            value: 924,
            name: '先玉1224'
        }
        ]
    },]
}
export const leftCenter = {
    backgroundColor: "transparent",
    barWidth: 8,
    xAxis: {
        type: 'value',
        show: false,
        splitLine: {
            lineStyle: {
                color: "rgba(255,255,255,0.2)"
            }
        },
        axisTick: {
            show: false
        },
        axisLine: { //  改变x轴颜色
            lineStyle: {
                color: '#26D9FF'
            }
        },
        axisLabel: { //  改变x轴字体颜色和大小
            textStyle: {
                color: "rgba(250,250,250,0.6)",
                fontSize: 16
            }
        }
    },
    grid: {
        top: '5%',
        left: '0%',
        right: '5%',
        bottom: '0%',
        containLabel: true
    },
    yAxis: {
        type: 'category',
        data: ['5月', '6月', '7月', '8月', '9月'],
        splitLine: {
            show: false
        },
        axisTick: {
            show: false
        },
        axisLine: { //  改变y轴颜色
            lineStyle: {
                color: '#26D9FF'
            }
        },
        axisLabel: { //  改变y轴字体颜色和大小
            //formatter: '{value} m³ ', //  给y轴添加单位
            textStyle: {
                color: "rgba(250,250,250,0.6)",
                fontSize: 16
            }
        }
    },
    series: [{
        type: 'bar',
        name: "FVI",
        itemStyle: {
            normal: {
                label: {
                    show: false, //开启显示
                    position: 'right', //在上方显示
                    textStyle: { //数值样式
                        color: "rgba(250,250,250,0.6)",
                        fontSize: 16,
                        fontWeight: 600
                    }
                },
                color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
                    offset: 0,
                    color: 'rgba(61,126,235,1)'
                }, {
                    offset: 1,
                    color: 'rgba(61,126,235,0)'
                }]),
                borderWidth: 2,
                barBorderRadius: 15
            }
        },
        data: [19, 29, 39, 81, 56]
    },
    {
        type: 'bar',
        name: "EVI",
        itemStyle: {
            normal: {
                label: {
                    show: false, //开启显示
                    position: 'right', //在上方显示
                    textStyle: { //数值样式
                        color: "rgba(250,250,250,0.6)",
                        fontSize: 16,
                        fontWeight: 600
                    }
                },
                color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
                    offset: 0,
                    color: 'rgba(15,197,243,1)'
                }, {
                    offset: 1,
                    color: 'rgba(15,197,243,0)'
                }]),
                borderWidth: 2,
                barBorderRadius: 15
            }
        },
        data: [12, 23, 35, 100, 45]
    }
    ]
};
export const leftBottom = {
    backgroundColor: 'transparent',
    tooltip: {
        trigger: 'axis',
        axisPointer: { // 坐标轴指示器，坐标轴触发有效
            type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
        },
    },
    legend: {
        selectedMode: false,//取消图例上的点击事件
        data: ['NDMI', 'LSWI']
    },
    grid: {
        left: '5px',
        top:'10%',
        right: '4%',
        bottom: '-0%',
        containLabel: true
    },
    xAxis: [{
        show: false,
        type: 'category',
        axisTick: false,// 不显示x轴的刻度
        data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日', '周一', '周二', '周三', '周四', '周五', '周六', '周日']
    }],
    yAxis: [{
        type: 'value',
        axisTick: false,// 不显示y轴的刻度
        axisLabel: {
            formatter: '{value}'
        },

    }],
    series: [
        {
            name: 'NDMI',
            type: 'bar',
            stack: '饱和度',
            barWidth: 10,
            data: [10, 13, 11, 13, 30, 23, 21, 12, 13, 10, 13, 20, 20, 10]
        },
        // {
        //     name: '已确认量',
        //     type: 'bar',
        //     stack: '饱和度',
        //     barWidth: 10,
        //     data: [20, 18, 19, 23, 29, 33, 31, 22, 12, 11, 24, 20, 33, 31]
        // },
        {
            name: 'LSWI',
            type: 'bar',
            stack: '饱和度',
            //barMaxWidth:30,//柱子的宽度
            barWidth: 10,
            data: [30, 18, 11, 23, 29, 33, 30, 22, 12, 11, 23, 29, 30, 31]
        }

    ]
};
export const rightTop = {
    tableColumns: [
        { key: 'A111', title: '土壤湿度' },
        { key: 'B111', title: '病虫害' },
        { key: 'C111', title: '雨雪灾害' },
    ],
    tableRows: [
        {
            A111: '2043',
            B111: '1876',
            C111: '1554',
            ID: '总数'
        },
        {
            A111: '1678',
            B111: '213',
            C111: '433',
            ID: '正常'
        },
        {
            A111: '781',
            B111: '445',
            C111: '33',

            ID: '预警'
        },
        {
            A111: '664',
            B111: '317',
            C111: '115',

            ID: '超限'
        },
        {
            A111: '741',
            B111: '234',
            C111: '15',
            ID: '冻结'
        },
        {
            A111: '124',
            B111: '22',
            C111: '0',
            ID: '督办'
        },
        {
            A111: '124',
            B111: '22',
            C111: '0',
            ID: '督办'
        },
        {
            A111: '124',
            B111: '22',
            C111: '0',
            ID: '督办'
        },
        {
            A111: '124',
            B111: '22',
            C111: '0',
            ID: '督办'
        },
        {
            A111: '124',
            B111: '22',
            C111: '0',
            ID: '督办'
        },
        {
            A111: '124',
            B111: '22',
            C111: '0',
            ID: '督办'
        },
    ],
}
export const rightBottom1 = [
    { name: '南关区反演数据', num: '20354', value: '76' },
    { name: '宽城区反演数据', num: '1254', value: '44' },
    { name: '朝阳区反演数据', num: '985', value: '38' },
    { name: '二道区反演数据', num: '211', value: '15' },
    { name: '绿园区反演数据', num: '117', value: '11' },
    { name: '双阳区反演数据', num: '59', value: '8' },
    { name: '九台区反演数据', num: '59', value: '8' },
    { name: '农安县反演数据', num: '59', value: '8' },
    { name: '榆树市反演数据', num: '59', value: '8' },
    { name: '德惠市反演数据', num: '59', value: '8' },
    { name: '公主岭市反演数据', num: '59', value: '8' },
]
var xData2 = ["南关区", "宽城区", "朝阳区", "二道区"];
var data1 = [200, 100, 200, 200];
var data2 = [300, 200, 300, 300];
export const rightBottom2 = {
    backgroundColor: 'transparent',
    tooltip: {
        trigger: 'item',
    },
    grid: {
        left: '-15%',
        right: '0%',
        top: '5%',
        bottom: '0%',
        containLabel: true
    },
    xAxis: {
        data: xData2,
        show: true,
        axisTick: {
            show: false
        },
        axisLine: {
            show: false,
            lineStyle: {
                type: 'solid',
                color: 'gray',
                opacity: 1
            }
        },
        // lineStyle: {
        //     show: true,
        //     type: 'solid'
        // },
        axisLabel: {
            interval: 0,
            textStyle: {
                color: '#fff',
                fontSize: 10,
            },
            margin: 20, //刻度标签与轴线之间的距离。
        },

    },
    yAxis: {
        name: '数量',
        show: false,
        nameTextStyle: {
            color: 'white',
            fontSize: 20,
            align: 'right',
            lineHeight: 46
        },
        splitLine: {
            show: true,
            lineStyle: {
                type: 'dashed',
                opacity: 0.5
            }
        },
        axisTick: {
            show: false
        },
        axisLine: {
            show: false
        },
        axisLabel: {
            textStyle: {
                color: '#fff',
                fontSize: 20,
            },
        }
    },
    series: [{ //三个最低下的圆片
        "name": "",
        "type": "pictorialBar",
        "symbolSize": [45, 25],
        "symbolOffset": [0, 10],
        "z": 12,
        itemStyle: {
            opacity: 1,
            color: function (params:any) {
                var a = params.name.slice(0, 2);
                return new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#12B9DB' // 0% 处的颜色
                }, {
                    offset: 1,
                    color: '#6F8EF2' // 100% 处的颜色
                }], false)
            }
        },
        "data": [0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
    },


    //下半截柱状图
    {
        name: '2020',
        type: 'bar',
        barWidth: 45,
        barGap: '-100%',
        itemStyle: { //lenged文本
            opacity: .7,
            color: function (params:any) {
                var a = params.name.slice(0, 2);

                return new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#12B9DB' // 0% 处的颜色
                }, {
                    offset: 1,
                    color: '#6F8EF2' // 100% 处的颜色
                }], false)

            }
        },

        data: data1
    },

    { // 替代柱状图 默认不显示颜色，是最下方柱图（邮件营销）的value值 - 20
        type: 'bar',
        barWidth: 45,
        barGap: '-100%',
        stack: '广告',
        itemStyle: {
            color: 'transparent'
        },
        data: data1
    },

    {
        "name": "", //头部
        "type": "pictorialBar",
        "symbolSize": [45, 25],
        "symbolOffset": [0, -10],
        "z": 12,
        "symbolPosition": "end",
        itemStyle: {
            color: '#163F7A',
            opacity: 1,
        },
        "data": data2
    },

    {
        "name": "",
        "type": "pictorialBar",
        "symbolSize": [45, 25],
        "symbolOffset": [0, -10],
        "z": 12,
        itemStyle: {
            opacity: 1,
            color: function (params:any) {
                var a = params.name.slice(0, 2);
                return new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#12B9DB' // 0% 处的颜色
                }, {
                    offset: 1,
                    color: '#6F8EF2' // 100% 处的颜色
                }], false)

            },
        },
        label: {
            normal: {
                show: true,
                position: 'inside',
                fontSize:15,
                color:'#fff'
            }
            
        },
        "symbolPosition": "end",
        "data": data1
    },

    {
        name: '2019',
        type: 'bar',
        barWidth: 45,
        barGap: '-100%',
        z: 0,
        itemStyle: {
            color: '#163F7A',
            opacity: .7,
            label: {
                show: true,
                position: "top",
                fontSize:10,
                color:'#fff'
                
            },
        },

        data: data2
    }


    ]
};
export const centerLeft ={
    backgroundColor: 'transparent',
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        }
    },
    grid: {
        left: '3%',
        right: '4%',
        top:'0%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: [{
        type: 'category',
        data: ['一月',
            '二月',
            '三月',
            '四月',
            '五月',
            '六月',
            '七月',
            '八月',
            '九月',
            '十月',
        ],
        axisLine: {
            show: true,
            lineStyle: {
                color: "#063374",
                width: 1,
                type: "solid"
            }
        },
        axisTick: {
            show: false,
        },
        axisLabel: {
            show: true,
            textStyle: {
                color: "#00c7ff",
            }
        },
    }],
    yAxis: [{
        show:false,
        type: 'value',
        axisLabel: {
            formatter: '{value} %'
        },
        axisTick: {
            show: false,
        },
        axisLine: {
            show: false,
            lineStyle: {
                color: "#00c7ff",
                width: 1,
                type: "solid"
            },
        },
        splitLine: {
            lineStyle: {
                color: "#063374",
            }
        }
    }],
    series: [{
        name: '吉农大819',
        type: 'bar',
        data: [20, 50, 80, 58, 83, 68, 57, 80, 42, 66],
        barWidth: 5, //柱子宽度
        barGap: 1, //柱子之间间距
        itemStyle: {
            normal: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#008cff'
                }, {
                    offset: 1,
                    color: '#005193'
                }]),
                opacity: 1,
            }
        }
    }, {
        name: '福来818',
        type: 'bar',
        data: [50, 70, 60, 61, 75, 87, 60, 62, 86, 46],
        barWidth: 5,
        barGap: 1,
        itemStyle: {
            normal: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#00da9c'
                }, {
                    offset: 1,
                    color: '#007a55'
                }]),
                opacity: 1,
            }
        }
    }, {
        name: '辽科38',
        type: 'bar',
        data: [70, 48, 73, 68, 53, 47, 50, 72, 96, 86],
        barWidth: 5,
        barGap: 1,
        itemStyle: {
            normal: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                    offset: 0,
                    color: '#c4e300'
                }, {
                    offset: 1,
                    color: '#728400'
                }]),
                opacity: 1,
            }
        }
    }]
};
export const centerRight ={
    backgroundColor: 'transparent',
	tooltip: { //提示框组件
		trigger: 'axis',
		formatter: '{b}<br />{a0}: {c0}<br />{a1}: {c1}',
		axisPointer: {
			type: 'shadow',
			label: {
				backgroundColor: '#6a7985'
			}
		},
		textStyle: {
			color: '#fff',
			fontStyle: 'normal',
			fontFamily: '微软雅黑',
			fontSize: 12,
		}
	},
	grid: {
		left: '1%',
		right: '8%',
		bottom: '0%',
		top:'0%',
		padding:'0 0 10 0',
		containLabel: true,
	},
	xAxis: [
		{
			type: 'category',
			boundaryGap: true,//坐标轴两边留白
			data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月'],
			axisLabel: { //坐标轴刻度标签的相关设置。
				interval: 0,//设置为 1，表示『隔一个标签显示一个标签』
				margin:15,
				textStyle: {
					color: '#078ceb',
					fontStyle: 'normal',
					fontFamily: '微软雅黑',
					fontSize: 12,
				}
			},
			axisTick:{//坐标轴刻度相关设置。
				show: false,
			},
			axisLine:{//坐标轴轴线相关设置
				lineStyle:{
					color:'#fff',
					opacity:0.2
				}
			},
			splitLine: { //坐标轴在 grid 区域中的分隔线。
				show: false,
			}
		}
	],
	yAxis: [
		{
            show:false,
			type: 'value',
			splitNumber: 5,
			axisLabel: {
				textStyle: {
					color: '#a8aab0',
					fontStyle: 'normal',
					fontFamily: '微软雅黑',
					fontSize: 12,
				}
			},
			axisLine:{
				show: false
			},
			axisTick:{
				show: false
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: ['#fff'],
					opacity:0.06
				}
			}

		}
	],
    series : [
        {
            name:'出售',
            type:'bar',
            data:[4.9, 7.3, 9.2, 5.6, 7.7, 5.6, 4.2, 3.6, 6, 6.4],
            barWidth: 10,
            barGap:0,//柱间距离
            label: {//图形上的文本标签
                normal: {
                   show: true,
                   position: 'top',
                   textStyle: {
                       color: '#a8aab0',
                       fontStyle: 'normal',
                       fontFamily: '微软雅黑',
                       fontSize: 12,   
                   },
                },
            },
            itemStyle: {//图形样式
                normal: {
					barBorderRadius: [5, 5, 0, 0],
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 1, color: 'rgba(127, 128, 225, 0.7)'
                    },{
                        offset: 0.9, color: 'rgba(72, 73, 181, 0.7)'
                    },{
                        offset: 0.31, color: 'rgba(0, 208, 208, 0.7)'
                    },{
                        offset: 0.15, color: 'rgba(0, 208, 208, 0.7)'
                    }, {
                        offset: 0, color: 'rgba(104, 253, 255, 0.7)'
                    }], false),
                },
            },
        },
        {
            name:'农民自用',
            type:'bar',
            data:[2.9, 5, 4.4, 2.7, 5.7, 4.6, 1.2, 2.7, 4.8, 6.0],
            barWidth: 10,
            barGap:0.2,//柱间距离
            label: {//图形上的文本标签
                normal: {
                   show: true,
                   position: 'top',
                   textStyle: {
                       color: '#a8aab0',
                       fontStyle: 'normal',
                       fontFamily: '微软雅黑',
                       fontSize: 12,   
                   },
                },
            },
            itemStyle: {//图形样式
                normal: {
					barBorderRadius: [5, 5, 0, 0],
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 1, color: 'rgba(127, 128, 225, 0.7)'
                    },{
                        offset: 0.9, color: 'rgba(72, 73, 181, 0.7)'
                    },{
                        offset: 0.25, color: 'rgba(226, 99, 74, 0.7)'
                    }, {
                        offset: 0, color: 'rgba(253, 200, 106, 0.7)'
                    }], false),
                },
            },
        }
    ]
};